develooper Front page | perl.perl5.porters | Postings from November 2003

[perl #24542] CGI multipart should support nph parameters

From:
Stephen Reindl
Date:
November 23, 2003 21:42
Subject:
[perl #24542] CGI multipart should support nph parameters
Message ID:
rt-24542-67761.11.5226588494587@rt.perl.org
# New Ticket Created by  Stephen Reindl 
# Please include the string:  [perl #24542]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24542 >



This is a bug report for perl from sr@stephenreindl.de,
generated with the help of perlbug 1.34 running under perl v5.8.1.


-----------------------------------------------------------------
I recognized a problem with a specific solution in Bugzilla
for multipart HTTP responses (see issue

http://bugzilla.mozilla.org/show_bug.cgi?id=226251

for details.)

The problem is that under some circumstances the nph flag has to be set.

The following patch enables this functionality and makes this depending on
the parameter or the global $NPH variable:


*** /usr/lib/perl5/5.8.1/CGI.pm~        2003-10-15 17:14:28.000000000 +0200
--- /usr/lib/perl5/5.8.1/CGI.pm 2003-11-22 14:42:39.000000000 +0100
***************
*** 1222,1234 ****
  'multipart_init' => <<'END_OF_FUNC',
  sub multipart_init {
      my($self,@p) = self_or_default(@_);
!     my($boundary,@other) = rearrange([BOUNDARY],@p);
      $boundary = $boundary || '------- =_aaaaaaaaaa0';
      $self->{'separator'} = "$CRLF--$boundary$CRLF";
      $self->{'final_separator'} = "$CRLF--$boundary--$CRLF";
      $type = SERVER_PUSH($boundary);
      return $self->header(
!       -nph => 1,
        -type => $type,
        (map { split "=", $_, 2 } @other),
      ) . "WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY." . $self->multipart_end;
--- 1222,1234 ----
  'multipart_init' => <<'END_OF_FUNC',
  sub multipart_init {
      my($self,@p) = self_or_default(@_);
!     my($boundary,$nph,@other) = rearrange([BOUNDARY,NPH],@p);
      $boundary = $boundary || '------- =_aaaaaaaaaa0';
      $self->{'separator'} = "$CRLF--$boundary$CRLF";
      $self->{'final_separator'} = "$CRLF--$boundary--$CRLF";
      $type = SERVER_PUSH($boundary);
      return $self->header(
!       -nph => $nph||$NPH,
        -type => $type,
        (map { split "=", $_, 2 } @other),
      ) . "WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY." . $self->multipart_end;



[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=high
---
Site configuration information for perl v5.8.1:

Configured by bhcompile at Wed Oct 15 10:50:03 EDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.21-2.elsmp, archname=i386-linux-thread-multi
    uname='linux daffy.perf.redhat.com 2.4.21-2.elsmp #1 smp wed sep 17 15:00:55 edt 2003 i686 i686 i386 gnulinux '
    config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 -Dversion=5.8.1 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.1 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dinc_version_list=5.8.0/i386-linux-thread-multi 5.8.0 -Dpager=/usr/bin/less -isr'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2 -g -pipe -march=i386 -mcpu=i686',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='3.3.1 20030930 (Red Hat Linux 3.3.1-6)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.1/i386-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.1:
    /usr/lib/perl5/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/5.8.1
    /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.1
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.1
    /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.0
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/5.8.1/i386-linux-thread-multi
    /usr/lib/perl5/5.8.1
    .

---
Environment for perl v5.8.1:
    HOME=/home/sr
    LANG=de_DE.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/home/sr/src/ACE_wrappers/build/g++/ace:/home/sr/src/ACE_wrappers/build/g++/ace:
    LOGDIR (unset)
    PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/sr/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About