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;
!}
|