Cover V05, I07
Article
Figure 1
Figure 2
Figure 3
Listing 1
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Listing 7
Listing 8
Sidebar 1
Sidebar 2

jul96.tar


Listing 8: Changes to the original program

if( $command eq "GET" ) {
if( $script ne "" ) {
!           if( $script =~ /.*\.class/ ) {
!               &do_applet( $script );
!           }
!           else {
!           &do_script( $script, %extras );
!           }
}
else {
&do_script( "./isps.pl", %extras );
}
}
elsif( $command eq "POST" ) {
}

}

!sub do_applet {
!
!    local( $applet ) = @_;
!    local( @buf, $cnt );
!
!    open APPLET, "$applet";
!
!    while( 1 ) {
!        $cnt = sysread APPLET, $buf, 512;
!        last if( $cnt == 0 );
!        syswrite CLIENT, $buf, $cnt;
!    }
!
!    close APPLET;
!}