Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old December 7th, 2004, 10:57 PM
SethTaylor SethTaylor is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 SethTaylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation VB client fails to upload simulated HTTP file upload requests > 32 KB via SSL

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).

Reply With Quote
  #2  
Old December 8th, 2004, 02:32 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
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

Reply With Quote
  #3  
Old December 8th, 2004, 05:40 PM
SethTaylor SethTaylor is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 SethTaylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB client fails to upload simulated HTTP file upload requests > 32 KB via SSL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway