PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/network/afpfs-ng/patches/afpfs-ng-0.8.1-05-boxee2.patch

http://github.com/OpenELEC/OpenELEC.tv
Patch | 90 lines | 81 code | 9 blank | 0 comment | 0 complexity | 566c8cfdd2d07555485aebe2a256150c MD5 | raw file
 1diff -Naur afpfs-ng-0.8.1/lib/afp.c afpfs-ng-0.8.1.patch/lib/afp.c
 2--- afpfs-ng-0.8.1/lib/afp.c	2011-09-10 12:14:34.181716631 +0200
 3+++ afpfs-ng-0.8.1.patch/lib/afp.c	2011-09-10 12:23:15.935726602 +0200
 4@@ -68,7 +68,7 @@
 5 	afp_getsessiontoken_reply,afp_blank_reply, NULL, NULL,
 6 	afp_enumerateext2_reply, NULL, NULL, NULL,    /*64 - 71 */
 7 	afp_listextattrs_reply, NULL, NULL, NULL,
 8-	afp_blank_reply, NULL, NULL, NULL,                       /*72 - 79 */
 9+	afp_blank_reply, NULL, afp_blank_reply, afp_blank_reply,                       /*72 - 79 */
10 
11 	NULL, NULL, NULL, NULL,
12 	NULL, NULL, NULL, NULL,
13@@ -320,8 +320,16 @@
14 	
15 	struct dsi_request * p;
16 	struct afp_server *s2;
17+
18+
19+	if (s==NULL) 
20+		goto out;
21+
22 	for (p=s->command_requests;p;p=p->next) {
23-		pthread_cond_signal(&p->condition_cond);
24+		pthread_mutex_lock(&p->waiting_mutex);
25+		p->done_waiting=1;
26+		pthread_cond_signal(&p->waiting_cond);
27+		pthread_mutex_unlock(&p->waiting_mutex);
28 	}
29 
30 	if (s==server_base) {
31@@ -354,7 +362,7 @@
32 	s->exit_flag = 0;
33 	s->path_encoding=kFPUTF8Name;  /* This is a default */
34 	s->next=NULL;
35-	s->bufsize=2048;
36+	s->bufsize=4096;
37 	s->incoming_buffer=malloc(s->bufsize);
38 
39 	s->attention_quantum=AFP_DEFAULT_ATTENTION_QUANTUM;
40@@ -524,13 +532,14 @@
41 			kFPVolCreateDateBit|kFPVolIDBit |
42 			kFPVolNameBit;
43 	char new_encoding;
44+     	int ret;
45 
46 	if (server->using_version->av_number>=30) 
47 		bitmap|= kFPVolNameBit|kFPVolBlockSizeBit;
48 
49-	switch (afp_volopen(volume,bitmap,
50-		(strlen(volume->volpassword)>0) ? volume->volpassword : NULL)) 
51-	{
52+	ret = afp_volopen(volume,bitmap,
53+		(strlen(volume->volpassword)>0) ? volume->volpassword : NULL);
54+	switch(ret){
55 	case kFPAccessDenied:
56 		*l+=snprintf(mesg,max-*l,
57 			"Incorrect volume password\n");
58@@ -544,6 +553,10 @@
59 		*l+=snprintf(mesg,max-*l,
60 			"Could not open volume\n");
61 		goto error;
62+	case ETIMEDOUT:
63+		*l+=snprintf(mesg,max-*l,
64+			"Timed out waiting to open volume\n");
65+		goto error;
66 	}
67 
68 	/* It is said that if a volume's encoding will be the same 
69@@ -641,7 +654,6 @@
70 	add_server(server);
71 
72 	add_fd_and_signal(server->fd);
73-
74 	if (!full) {
75 		return 0;
76 	}
77@@ -649,10 +661,13 @@
78 	/* Get the status, and calculate the transmit time.  We use this to
79 	* calculate our rx quantum. */
80 	gettimeofday(&t1,NULL);
81+
82 	if ((error=dsi_getstatus(server))!=0) 
83 		goto error;
84 	gettimeofday(&t2,NULL);
85 
86+        afp_server_identify(server);
87+
88 	if ((t2.tv_sec - t1.tv_sec) > 0)
89 		server->tx_delay= (t2.tv_sec - t1.tv_sec) * 1000;
90 	else