Sponsored Content
Top Forums Programming Need help regarding HTTP parsing Post 302340815 by Corona688 on Tuesday 4th of August 2009 11:21:32 AM
Old 08-04-2009
recv() doesn't add null terminators to anything, you can't just use strcpy on raw binary data.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

HTTP Query Request & Parsing returned XML output

I have a PERL script from which I need to make a HTTP request to Web Servlet (Essentially a URL with variables and values like &Variable1=AAAAAA&Variable2=BBBBBBBBB&Variable3=CCCCCCC). The Web servlet returns an XML result which needs to be parsed for the contents of the result within the program.... (15 Replies)
Discussion started by: jerardfjay
15 Replies

2. UNIX for Advanced & Expert Users

http

how to downloaad a web page using http server (0 Replies)
Discussion started by: krishnavel
0 Replies

3. Shell Programming and Scripting

Perl parsing compared to Ksh parsing

#! /usr/local/bin/perl -w $ip = "$ARGV"; $rw = "$ARGV"; $snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw"; $snmpw = "/usr/local/bin/snmpwalk -Os -c $rw"; $syst=`$snmpg $ip system sysName sysObjectID`; sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies

4. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

5. Linux

Dynamic HTTP

hi guys, please i would like to know how to cache dynamic websites, on squid 3.1 thanks (1 Reply)
Discussion started by: zazoo
1 Replies

6. Programming

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (0 Replies)
Discussion started by: senkerth
0 Replies

7. Shell Programming and Scripting

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (4 Replies)
Discussion started by: senkerth
4 Replies

8. Shell Programming and Scripting

Parsing the http post request

Hi, I am trying to write a shell script to parse the post request data that it received to a xml file. Below is the post request data that script is receiving. -----------------------------7dd2339190c8e Content-Disposition: form-data; name="param1" 1... (2 Replies)
Discussion started by: jdp
2 Replies

9. Web Development

HTTP Headers Reference: HTTP Status-Codes

Hypertext Transfer Protocol -- HTTP/1.1 for Reference - HTTP Headers 10 Status Code Definitions Each Status-Code is described below, including a description of which method(s) it can follow and any metainformation required in the response. (1 Reply)
Discussion started by: Neo
1 Replies

10. Shell Programming and Scripting

awk script to find time difference between HTTP PUT and HTTP DELETE requests in access.log

Hi, I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log. Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
Discussion started by: Juha
3 Replies
strcpy(9F)						   Kernel Functions for Drivers 						strcpy(9F)

NAME
strcpy, strlcat, strlcpy, strncat, strncpy, strspn - String operations. SYNOPSIS
#include <sys/ddi.h> char *strcpy(char *dst, const char *src); size_t strlcat(char *dst, const char *src, size_t dstsize); size_t strlcpy(char *dst, const char *src, size_t dstsize); char *strncat(char *restrict s1, const char *restrict s2, size_t n); char *strncpy(char *dst, const char *src, size_t n); size_t strspn(const char *s1, const char *s2); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
dst, src Pointers to character strings. s1, s2 Pointers to character strings. n Count of characters to be copied. DESCRIPTION
The arguments dst, src, s1 and s2 point to strings. The strcpy(), strlcpy(), strncpy(), strlcat() and strncat() functions all alter their first argument. These functions do not check for overflow of the array pointed to by the first argument. strcpy() The strcpy() function copies characters in the string src to dst, terminating at the first null character in src, and returns dst to the caller. No bounds checking is done. strncpy() The strncpy() function copies src to dst, null-padding or truncating at n bytes, and returns dst. No bounds checking is done. strlcpy() The strlcpy() function copies a maximum of dstsize-1 characters (where dstsize represents the size of the string buffer dst) from src to dst, truncating src if necessary. The result is always null-terminated. The function returns strlen(src). Buffer overflow can be checked as follows: if (strlcpy(dst, src, dstsize) >= dstsize) return (-1); strncat() The strncat() function appends a maximum of n characters. The initial character of s2 overrides the null character at the end of s1. strlcat() The strlcat() function appends a maximum of (dstsize- strlen(dst)-1) characters of src to dst (where dstsize represents the size of the string buffer dst). If the string pointed to by dst contains a null-terminated string that fits into dstsize bytes when strlcat() is called, the string pointed to by dst is a null-terminated string that fits in dstsize bytes (including the terminating null character) when it completes, and the initial character of src overrides the null character at the end of dst. If the string pointed to by dst is longer than dstsize bytes when strlcat() is called, the string pointed to by dst is not changed. The function returns min{dst- size,strlen(dst)}+strlen(src). Buffer overflow can be checked as follows: if (strlcat(dst, src, dstsize) >= dstsize) return -1; strspn() The strspn() function returns the length of the initial segment of string s1 that consists entirely of characters from string s2. RETURN VALUES
strcpy(), strncat() and strncpy() return dst. For strlcat(), strlcpy() and strspn(), see the Description section. CONTEXT
These functions can be called from user or interrupt context. SEE ALSO
strlen(9F), strcmp(9F), bcopy(9F), ddi_copyin(9F) Writing Device Drivers SunOS 5.10 7 Sep 2004 strcpy(9F)
All times are GMT -4. The time now is 02:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy