|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Goal: Upload binary file(s) and data from custom VB client to pure ASP upload script via HTTPS
Info: Upload from html page seems to work fine. When uploading from VB client, connection times out if request size is over 32 KB limit and no response is received. Seems to work for requests less than 32 KB ... Requirements: HTTPS, multiple binary files and data, pure ASP upload script, custom VB client Question: What am I missing? This project is now 3 weeks over due and I can't figure out what is wrong. I am using code from 3 different samples/articles available on line (I don't remember where) ... The client application uses a winsock control, using ssl encryption, and constructs a request packet duplicating the "post" method of an html file upload page. I assumed that any file size could be uploaded, as is evident from using an html form. Is there something a browser does with large requests to get the server to accept requests larger than 32KB? I am not sure which part of the code needs to be reviewed ... I will supply required code as needed (http request simulation, SSL encryption, or winsock functions). |
|
#2
|
|||
|
|||
|
Anytime you run into a 32k boundary, a good thing to look for is an integer counter or a variable type that's an int but should be a long. Integers count to +- 32k
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Hmmm ... now that you mention it, I just did some looking around ... I didn't find any integer/long size issues, but I did look over the function that chunks the request into *32 KB* pieces for uploading. Appears the original author made an error in the code, which I have corrected below (in case anyone else has this particular code):
"SSLv2 (SSL.bas)" Public Sub SSLSend(ByRef Socket As Winsock, ByVal Plaintext As String) 'Send Plaintext as an Encrypted SSL Record Dim SSLRecord As String Dim OtherPart As String Dim SendAnother As Boolean If Len(Plaintext) > 32751 Then SendAnother = True OtherPart = Mid(Plaintext, 32752) ' This must be *before* next line of code or else null string returned Plaintext = Mid(Plaintext, 1, 32751) Else SendAnother = False End If SSLRecord = AddMACData(Plaintext) SSLRecord = SecureSession.RC4_Encrypt(SSLRecord) SSLRecord = AddRecordHeader(SSLRecord) Socket.SendData SSLRecord If SendAnother = True Then Call SSLSend(Socket, OtherPart) End If End Sub |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VB client fails to upload simulated HTTP file upload requests > 32 KB via SSL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|