comparison libinterp/corefcn/urlwrite.cc @ 17596:43b9181340fb

separate object creation from http actions in url_transfer class * url-transfer.h, url-transfer.cc: New functions for http GET and POST actions. Don't perform action in URL constructor. Keep track of FTP vs. HTTP object type. * urlwrite.cc: Update to match.
author John W. Eaton <jwe@octave.org>
date Mon, 07 Oct 2013 23:15:06 -0400
parents 9e8a9f043944
children d63878346099
comparison
equal deleted inserted replaced
17595:4b65355a31f2 17596:43b9181340fb
408 408
409 unwind_protect_safe frame; 409 unwind_protect_safe frame;
410 410
411 frame.add_fcn (delete_file, filename); 411 frame.add_fcn (delete_file, filename);
412 412
413 url_transfer curl = url_transfer (url, method, param, ofile); 413 url_transfer curl = url_transfer (url, ofile);
414
415 curl.http_action (param, method);
414 416
415 ofile.close (); 417 ofile.close ();
416 418
417 if (curl.good ()) 419 if (curl.good ())
418 frame.discard (); 420 frame.discard ();
533 } 535 }
534 } 536 }
535 537
536 std::ostringstream buf; 538 std::ostringstream buf;
537 539
538 url_transfer curl = url_transfer (url, method, param, buf); 540 url_transfer curl = url_transfer (url, buf);
541
542 curl.http_action (param, method);
539 543
540 if (curl.good ()) 544 if (curl.good ())
541 { 545 {
542 if (nargout > 0) 546 if (nargout > 0)
543 { 547 {