 |
Changeset 3761
- Timestamp:
- 07/19/08 15:52:55
(5 months ago)
- Author:
- kris
- Message:
fixes 1195 :: createSocket disappeared from HttpPost?
thanks to alexn
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3680 |
r3761 |
|
| 416 | 416 | if (socket is null) |
|---|
| 417 | 417 | { |
|---|
| 418 | | socket = new SocketConduit; |
|---|
| | 418 | socket = createSocket; |
|---|
| 419 | 419 | socket.setTimeout (timeout); |
|---|
| 420 | 420 | socket.connect (address); |
|---|
| … | … | |
| 559 | 559 | // return the input buffer |
|---|
| 560 | 560 | return input; |
|---|
| 561 | | } |
|---|
| 562 | | /*********************************************************************** |
|---|
| 563 | | |
|---|
| 564 | | Make a request for the resource specified via the constructor |
|---|
| 565 | | using the specified timeout period (in micro-seconds), and a |
|---|
| 566 | | user-defined callback for pumping additional data to the host. |
|---|
| 567 | | The callback would be used when uploading data during a 'put' |
|---|
| 568 | | operation (or equivalent). The return value represents the |
|---|
| 569 | | input buffer, from which all returned headers and content may |
|---|
| 570 | | be accessed. |
|---|
| 571 | | |
|---|
| 572 | | Note that certain request-headers may generated automatically |
|---|
| 573 | | if they are not present. These include a Host header and, in |
|---|
| 574 | | the case of Post, both ContentType & ContentLength for a query |
|---|
| 575 | | type of request. The latter two are *not* produced for Post |
|---|
| 576 | | requests with 'pump' specified ~ when using 'pump' to output |
|---|
| 577 | | additional content, you must explicitly set your own headers. |
|---|
| 578 | | |
|---|
| 579 | | Note also that IOException instances may be thrown. These |
|---|
| 580 | | should be caught by the client to ensure a close() operation |
|---|
| 581 | | is always performed |
|---|
| 582 | | |
|---|
| 583 | | ***********************************************************************/ |
|---|
| 584 | | |
|---|
| 585 | | private IBuffer open (RequestMethod method, Pump pump, IBuffer input) |
|---|
| 586 | | { |
|---|
| 587 | | try { |
|---|
| 588 | | this.method = method; |
|---|
| 589 | | openStart(pump, input); |
|---|
| 590 | | // user has additional data to send? |
|---|
| 591 | | |
|---|
| 592 | | return openFinish(pump); |
|---|
| 593 | | } finally {redirections = 0;} |
|---|
| 594 | 561 | } |
|---|
| 595 | 562 | |
|---|
| … | … | |
| 676 | 643 | return false; |
|---|
| 677 | 644 | } |
|---|
| | 645 | |
|---|
| | 646 | /*********************************************************************** |
|---|
| | 647 | |
|---|
| | 648 | Overridable socket factory, for use with HTTPS and so on |
|---|
| | 649 | |
|---|
| | 650 | ***********************************************************************/ |
|---|
| | 651 | |
|---|
| | 652 | protected SocketConduit createSocket () |
|---|
| | 653 | { |
|---|
| | 654 | return new SocketConduit; |
|---|
| | 655 | } |
|---|
| | 656 | |
|---|
| | 657 | /*********************************************************************** |
|---|
| | 658 | |
|---|
| | 659 | Make a request for the resource specified via the constructor |
|---|
| | 660 | using the specified timeout period (in micro-seconds), and a |
|---|
| | 661 | user-defined callback for pumping additional data to the host. |
|---|
| | 662 | The callback would be used when uploading data during a 'put' |
|---|
| | 663 | operation (or equivalent). The return value represents the |
|---|
| | 664 | input buffer, from which all returned headers and content may |
|---|
| | 665 | be accessed. |
|---|
| | 666 | |
|---|
| | 667 | Note that certain request-headers may generated automatically |
|---|
| | 668 | if they are not present. These include a Host header and, in |
|---|
| | 669 | the case of Post, both ContentType & ContentLength for a query |
|---|
| | 670 | type of request. The latter two are *not* produced for Post |
|---|
| | 671 | requests with 'pump' specified ~ when using 'pump' to output |
|---|
| | 672 | additional content, you must explicitly set your own headers. |
|---|
| | 673 | |
|---|
| | 674 | Note also that IOException instances may be thrown. These |
|---|
| | 675 | should be caught by the client to ensure a close() operation |
|---|
| | 676 | is always performed |
|---|
| | 677 | |
|---|
| | 678 | ***********************************************************************/ |
|---|
| | 679 | |
|---|
| | 680 | private IBuffer open (RequestMethod method, Pump pump, IBuffer input) |
|---|
| | 681 | { |
|---|
| | 682 | try { |
|---|
| | 683 | this.method = method; |
|---|
| | 684 | openStart(pump, input); |
|---|
| | 685 | // user has additional data to send? |
|---|
| | 686 | |
|---|
| | 687 | return openFinish(pump); |
|---|
| | 688 | } finally {redirections = 0;} |
|---|
| | 689 | } |
|---|
| 678 | 690 | } |
|---|
| 679 | 691 | |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic