Subversion Repositories camp_sysinfo_client_3

Rev

Rev 233 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 233 Rev 234
Line 113... Line 113...
113
      &writeFile( $saveFileName, $message ); # make a backup copy of the report
113
      &writeFile( $saveFileName, $message ); # make a backup copy of the report
114
      $postData{ $$parameters{'key for report'} } =  
114
      $postData{ $$parameters{'key for report'} } =  
115
                              [ #'/tmp/theReport' => 'myReport'
115
                              [ #'/tmp/theReport' => 'myReport'
116
                                 undef,
116
                                 undef,
117
                                 'temp.report',
117
                                 'temp.report',
118
                                 'Content-Type' => 'application/yaml; charset=UTF-8',
118
                                 'Content-Type' => 'application/x-www-form-urlencoded',
119
                                 'Content' => $message
119
                                 'Content' => $message
120
                              ];
120
                              ];
121
   } else {
121
   } else {
122
      return 5; # no key given for report
122
      return 5; # no key given for report
123
   }
123
   }
Line 148... Line 148...
148
      $$parameters{'report date'} . '_' . 
148
      $$parameters{'report date'} . '_' . 
149
      $$parameters{'client name'} . '_' . 
149
      $$parameters{'client name'} . '_' . 
150
      $$parameters{'host name'} . '_' . 
150
      $$parameters{'host name'} . '_' . 
151
      $$parameters{'serial number'} . 
151
      $$parameters{'serial number'} . 
152
      '.yaml';
152
      '.yaml';
153
   print Dumper( \%postData ); die;
153
   #print Dumper( \%postData ); die;
154
   my $result = sendData( $url, \%postData );
154
   my $result = sendData( $url, \%postData );
155
   if ( $result->is_success ) { # we got a response, so validate the transfer
155
   if ( $result->is_success ) { # we got a response, so validate the transfer
156
      #print $result->status_line . "\n"; die;
156
      #print $result->status_line . "\n"; die;
157
      #unless ( ! looks_like_number( $result->content ) && ( $result->content * 1) == length($message) ) { # report returned was not one we sent
157
      #unless ( ! looks_like_number( $result->content ) && ( $result->content * 1) == length($message) ) { # report returned was not one we sent
158
      #   print STDERR "Server did not read file correctly\nWe sent " . length($message) . " bytes but server only saved " . $result->content . "\n";
158
      #   print STDERR "Server did not read file correctly\nWe sent " . length($message) . " bytes but server only saved " . $result->content . "\n";