Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision daf4e53e86280f84070fb9d895f73ce80e95229d authored by Bodo Möller on 07 March 2000, 15:10:08 UTC, committed by Bodo Möller on 07 March 2000, 15:10:08 UTC
spelling
1 parent 068fdce
  • Files
  • Changes
  • d3be087
  • /
  • demos
  • /
  • eay
  • /
  • conn.c
Raw File
Cook and download a directory from the Software Heritage Vault

You have requested the cooking of the directory with identifier None into a standard tar.gz archive.

Are you sure you want to continue ?

Download a directory from the Software Heritage Vault

You have requested the download of the directory with identifier None as a standard tar.gz archive.

Are you sure you want to continue ?

Cook and download a revision from the Software Heritage Vault

You have requested the cooking of the history heading to revision with identifier swh:1:rev:daf4e53e86280f84070fb9d895f73ce80e95229d into a bare git archive.

Are you sure you want to continue ?

Download a revision from the Software Heritage Vault

You have requested the download of the history heading to revision with identifier swh:1:rev:daf4e53e86280f84070fb9d895f73ce80e95229d as a bare git archive.

Are you sure you want to continue ?

Invalid Email !

The provided email is not well-formed.

Download link has expired

The requested archive is no longer available for download from the Software Heritage Vault.

Do you want to cook it again ?

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • content
revision badge
swh:1:rev:daf4e53e86280f84070fb9d895f73ce80e95229d
content badge Iframe embedding
swh:1:cnt:c4b8f5163e1154fae3efc18475e80bf20d1c4d02
conn.c
/* NOCW */
/* demos/eay/conn.c */

/* A minimal program to connect to a port using the sock4a protocol.
 *
 * cc -I../../include conn.c -L../.. -lcrypto
 */
#include <stdio.h>
#include <stdlib.h>
#include <openssl/err.h>
#include <openssl/bio.h>
/* #include "proxy.h" */

extern int errno;

int main(argc,argv)
int argc;
char *argv[];
	{
	PROXY *pxy;
	char *host;
	char buf[1024*10],*p;
	BIO *bio;
	int i,len,off,ret=1;

	if (argc <= 1)
		host="localhost:4433";
	else
		host=argv[1];

	/* Lets get nice error messages */
	ERR_load_crypto_strings();

	/* First, configure proxy settings */
	pxy=PROXY_new();
	PROXY_add_server(pxy,PROXY_PROTOCOL_SOCKS,"gromit:1080");

	bio=BIO_new(BIO_s_socks4a_connect());

	BIO_set_conn_hostname(bio,host);
	BIO_set_proxies(bio,pxy);
	BIO_set_socks_userid(bio,"eay");
	BIO_set_nbio(bio,1);

	p="GET / HTTP/1.0\r\n\r\n";
	len=strlen(p);

	off=0;
	for (;;)
		{
		i=BIO_write(bio,&(p[off]),len);
		if (i <= 0)
			{
			if (BIO_should_retry(bio))
				{
				fprintf(stderr,"write DELAY\n");
				sleep(1);
				continue;
				}
			else
				{
				goto err;
				}
			}
		off+=i;
		len-=i;
		if (len <= 0) break;
		}

	for (;;)
		{
		i=BIO_read(bio,buf,sizeof(buf));
		if (i == 0) break;
		if (i < 0)
			{
			if (BIO_should_retry(bio))
				{
				fprintf(stderr,"read DELAY\n");
				sleep(1);
				continue;
				}
			goto err;
			}
		fwrite(buf,1,i,stdout);
		}

	ret=1;

	if (0)
		{
err:
		if (ERR_peek_error() == 0) /* system call error */
			{
			fprintf(stderr,"errno=%d ",errno);
			perror("error");
			}
		else
			ERR_print_errors_fp(stderr);
		}
	BIO_free_all(bio);
	if (pxy != NULL) PROXY_free(pxy);
	exit(!ret);
	return(ret);
	}

The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top