Differences From Artifact [6764d44297]:
- File src/http_socket.c — part of check-in [6e7cb7f27a] at 2014-12-12 06:30:43 on branch trunk — On 302 redirects, cause addr and socket reinitialize so it has the info for the new location and not the old. This may address a bug reported on the ML by Ashwin Hirschi in which a redirect was causing Fossil to segfault, likely due to redirecting to the same site repeatedly because addr was remaining unchanged. (user: andybradford size: 6223)
To Artifact [957fcf6bde]:
- File src/http_socket.c — part of check-in [522cf5f66d] at 2014-12-12 16:04:53 on branch trunk — Reset memory in addr for good measure just to be certain nothing is left over. (user: andybradford size: 6259) [more...]
| ︙ | |||
136 137 138 139 140 141 142 143 144 145 146 147 148 149 | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | + |
** Return the number of errors.
*/
int socket_open(UrlData *pUrlData){
static struct sockaddr_in addr; /* The server address */
socket_global_init();
if( !addrIsInit ){
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(pUrlData->port);
*(int*)&addr.sin_addr = inet_addr(pUrlData->name);
if( -1 == *(int*)&addr.sin_addr ){
#ifndef FOSSIL_STATIC_LINK
struct hostent *pHost;
pHost = gethostbyname(pUrlData->name);
|
| ︙ |