Raised This Month: $ Target: $400
 0% 

[EXTENSION] Socket (3.0.1)


Post New Thread Reply   
 
Thread Tools Display Modes
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 02-17-2010 , 15:10   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #241

Just awesome.

Now how would one remove http header from the received data?
Mr. Zero is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 02-17-2010 , 15:22   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #242

The header is separated by \r\n\r\n.

You receive packets until you've found the separation sequence. If a packet doesn't contain it, you still have to check/save the last 3 bytes, because it might be splitted across 2 packets. In the next packet check if the combination "last 3 bytes of previous packet"+current packet contains \r\n\r\n. Repeat until you found it and then start assembling the content.

You'll need a dynamically extending content buffer or at least one which is large enough for anything you might need if you don't directly write to a file.

Stop receiving until you get a disconnect (if you use Connection: close in the request headers, recommended), the length of the content buffer matches content-length (if the server sent it) or something way more complicated with pipelining (you don't want to use that).

If you download only a small amount of data you can just dump everything (headers+content) into a buffer, search for \r\n\r\n and use buffer[searchResult+4] as your content string.

Last edited by sfPlayer; 02-17-2010 at 15:25.
sfPlayer is offline
shoto1699
New Member
Join Date: Feb 2010
Old 02-18-2010 , 22:18   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #243

hey i get [SM] Unable to load plugin "serverhop.smx": Required extension "Socket" file("socket.ext") not running

that when im trying to run server hop.
shoto1699 is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 02-18-2010 , 22:27   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #244

There is usually a more useful error message a few lines before, which states why socket.ext didn't load
sfPlayer is offline
shoto1699
New Member
Join Date: Feb 2010
Old 02-18-2010 , 22:58   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #245

i see. well im hosting on a dedi linux server without a cpanel..
shoto1699 is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 02-18-2010 , 23:14   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #246

It should be in the sourcemod error log files, maybe an older one.

Afaik sm exts list also displays the error message.
sfPlayer is offline
shoto1699
New Member
Join Date: Feb 2010
Old 02-19-2010 , 01:44   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #247

[SM] Unable to load extension "socket.ext": /lib/libc.so.6: version `GLIBC_2.7' not found (required by /home/amy/srcds_1/orangebox/tf/addons/sourcemod/extensions/socket.ext.so)
shoto1699 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-19-2010 , 02:30   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #248

Building against glibc 2.7 is probably going to cause issues for alot of people.
__________________
asherkin is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 02-19-2010 , 03:56   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #249

oops, I'm working on that.
sfPlayer is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 02-19-2010 , 05:20   Re: [EXTENSION] Socket (3.0.1alpha)
Reply With Quote #250

fixed, the new build is satisfied with glibc 2.3.2

thanks for the report.

Last edited by sfPlayer; 02-19-2010 at 05:26.
sfPlayer is offline
Reply



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode