minor fixes;
This commit is contained in:
		
							parent
							
								
									cf2cb4236a
								
							
						
					
					
						commit
						d15b74198a
					
				
							
								
								
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -52,3 +52,8 @@ coq
 | 
				
			|||||||
lib/libsntllv2.pc
 | 
					lib/libsntllv2.pc
 | 
				
			||||||
lv2sd
 | 
					lv2sd
 | 
				
			||||||
lv2sc
 | 
					lv2sc
 | 
				
			||||||
 | 
					debian/substvars
 | 
				
			||||||
 | 
					tests/*.xml
 | 
				
			||||||
 | 
					tests/lv2ftpd
 | 
				
			||||||
 | 
					tests/lv2ftpc
 | 
				
			||||||
 | 
					tests/*.cfg
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										50
									
								
								debian/libsntl-dev.debhelper.log
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										50
									
								
								debian/libsntl-dev.debhelper.log
									
									
									
									
										vendored
									
									
								
							@ -1,50 +0,0 @@
 | 
				
			|||||||
dh_autotools-dev_updateconfig
 | 
					 | 
				
			||||||
dh_auto_configure
 | 
					 | 
				
			||||||
dh_auto_build
 | 
					 | 
				
			||||||
dh_auto_test
 | 
					 | 
				
			||||||
dh_prep
 | 
					 | 
				
			||||||
dh_installdirs
 | 
					 | 
				
			||||||
dh_auto_install
 | 
					 | 
				
			||||||
dh_install
 | 
					 | 
				
			||||||
dh_installdocs
 | 
					 | 
				
			||||||
dh_installchangelogs
 | 
					 | 
				
			||||||
dh_installexamples
 | 
					 | 
				
			||||||
dh_installman
 | 
					 | 
				
			||||||
dh_installcatalogs
 | 
					 | 
				
			||||||
dh_installcron
 | 
					 | 
				
			||||||
dh_installdebconf
 | 
					 | 
				
			||||||
dh_installemacsen
 | 
					 | 
				
			||||||
dh_installifupdown
 | 
					 | 
				
			||||||
dh_installinfo
 | 
					 | 
				
			||||||
dh_pysupport
 | 
					 | 
				
			||||||
dh_installinit
 | 
					 | 
				
			||||||
dh_installmenu
 | 
					 | 
				
			||||||
dh_installmime
 | 
					 | 
				
			||||||
dh_installmodules
 | 
					 | 
				
			||||||
dh_installlogcheck
 | 
					 | 
				
			||||||
dh_installlogrotate
 | 
					 | 
				
			||||||
dh_installpam
 | 
					 | 
				
			||||||
dh_installppp
 | 
					 | 
				
			||||||
dh_installudev
 | 
					 | 
				
			||||||
dh_installwm
 | 
					 | 
				
			||||||
dh_installxfonts
 | 
					 | 
				
			||||||
dh_installgsettings
 | 
					 | 
				
			||||||
dh_bugfiles
 | 
					 | 
				
			||||||
dh_ucf
 | 
					 | 
				
			||||||
dh_lintian
 | 
					 | 
				
			||||||
dh_gconf
 | 
					 | 
				
			||||||
dh_icons
 | 
					 | 
				
			||||||
dh_perl
 | 
					 | 
				
			||||||
dh_usrlocal
 | 
					 | 
				
			||||||
dh_link
 | 
					 | 
				
			||||||
dh_compress
 | 
					 | 
				
			||||||
dh_fixperms
 | 
					 | 
				
			||||||
dh_strip
 | 
					 | 
				
			||||||
dh_makeshlibs
 | 
					 | 
				
			||||||
dh_shlibdeps
 | 
					 | 
				
			||||||
dh_installdeb
 | 
					 | 
				
			||||||
dh_gencontrol
 | 
					 | 
				
			||||||
dh_md5sums
 | 
					 | 
				
			||||||
dh_builddeb
 | 
					 | 
				
			||||||
dh_builddeb
 | 
					 | 
				
			||||||
dh_builddeb
 | 
					 | 
				
			||||||
							
								
								
									
										5
									
								
								debian/libsntl.postinst.debhelper
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								debian/libsntl.postinst.debhelper
									
									
									
									
										vendored
									
									
								
							@ -1,5 +0,0 @@
 | 
				
			|||||||
# Automatically added by dh_makeshlibs
 | 
					 | 
				
			||||||
if [ "$1" = "configure" ]; then
 | 
					 | 
				
			||||||
	ldconfig
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
# End automatically added section
 | 
					 | 
				
			||||||
							
								
								
									
										5
									
								
								debian/libsntl.postrm.debhelper
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								debian/libsntl.postrm.debhelper
									
									
									
									
										vendored
									
									
								
							@ -1,5 +0,0 @@
 | 
				
			|||||||
# Automatically added by dh_makeshlibs
 | 
					 | 
				
			||||||
if [ "$1" = "remove" ]; then
 | 
					 | 
				
			||||||
	ldconfig
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
# End automatically added section
 | 
					 | 
				
			||||||
							
								
								
									
										2
									
								
								debian/libsntl.substvars
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/libsntl.substvars
									
									
									
									
										vendored
									
									
								
							@ -1,2 +0,0 @@
 | 
				
			|||||||
shlibs:Depends=libc6 (>= 2.2.5), libsexpr, libssl1.0.0 (>= 1.0.1), libtdata, libuuid1 (>= 2.20.1)
 | 
					 | 
				
			||||||
misc:Depends=
 | 
					 | 
				
			||||||
@ -139,7 +139,7 @@ static int __get_channels_list(void *cctx, sexp_t *sx)
 | 
				
			|||||||
                     list_ent->type_id, list_ent->description);
 | 
					                     list_ent->type_id, list_ent->description);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  ulen += snprintf(buf + ulen, maxlen - ulen, ")");
 | 
					  ulen += snprintf(buf + ulen, maxlen - ulen, ")");
 | 
				
			||||||
  msg->mhead.payload_length = ulen + sizeof(sntllv2_head_t);
 | 
					  msg->mhead.payload_length = ulen + 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* we're ready for messaging mode */
 | 
					  /* we're ready for messaging mode */
 | 
				
			||||||
  co->flags |= SNSX_MESSAGINGMODE;
 | 
					  co->flags |= SNSX_MESSAGINGMODE;
 | 
				
			||||||
 | 
				
			|||||||
@ -156,53 +156,6 @@ int msg_send(chnl_t *ch, const char *mmbuf, size_t buflen, sxmsg_t *msg, char **
 | 
				
			|||||||
  return mr;
 | 
					  return mr;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static pthread_mutex_t *lockarray;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void lock_callback(int mode, int type, char *file, int line)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  (void)file;
 | 
					 | 
				
			||||||
  (void)line;
 | 
					 | 
				
			||||||
  if (mode & CRYPTO_LOCK) {
 | 
					 | 
				
			||||||
    pthread_mutex_lock(&(lockarray[type]));
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  else {
 | 
					 | 
				
			||||||
    pthread_mutex_unlock(&(lockarray[type]));
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
static unsigned long thread_id(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  unsigned long ret;
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
  ret=(unsigned long)pthread_self();
 | 
					 | 
				
			||||||
  return(ret);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
static void init_locks(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  int i;
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
  lockarray=(pthread_mutex_t *)OPENSSL_malloc(CRYPTO_num_locks() *
 | 
					 | 
				
			||||||
                                            sizeof(pthread_mutex_t));
 | 
					 | 
				
			||||||
  for (i=0; i<CRYPTO_num_locks(); i++) {
 | 
					 | 
				
			||||||
    pthread_mutex_init(&(lockarray[i]),NULL);
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
  CRYPTO_set_id_callback((unsigned long (*)())thread_id);
 | 
					 | 
				
			||||||
  CRYPTO_set_locking_callback((void (*)())lock_callback);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
static void kill_locks(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  int i;
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
  CRYPTO_set_locking_callback(NULL);
 | 
					 | 
				
			||||||
  for (i=0; i<CRYPTO_num_locks(); i++)
 | 
					 | 
				
			||||||
    pthread_mutex_destroy(&(lockarray[i]));
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
  OPENSSL_free(lockarray);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int main(int argc, char **argv)
 | 
					int main(int argc, char **argv)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  char *rootca = NULL, *cert = NULL;
 | 
					  char *rootca = NULL, *cert = NULL;
 | 
				
			||||||
@ -265,7 +218,6 @@ int main(int argc, char **argv)
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  sntl_init();
 | 
					  sntl_init();
 | 
				
			||||||
  init_locks();
 | 
					 | 
				
			||||||
  /* all is fine let's init connection subsystem */
 | 
					  /* all is fine let's init connection subsystem */
 | 
				
			||||||
  ssys = connections_create();
 | 
					  ssys = connections_create();
 | 
				
			||||||
  if(!ssys) {
 | 
					  if(!ssys) {
 | 
				
			||||||
 | 
				
			|||||||
@ -429,6 +429,11 @@ int main(int argc, char **argv)
 | 
				
			|||||||
    fprintf(stderr, "Failed to add typed RPC channel\n Failure.\n");
 | 
					    fprintf(stderr, "Failed to add typed RPC channel\n Failure.\n");
 | 
				
			||||||
    return opt;
 | 
					    return opt;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  opt = sntl_rpclist_add(fulist, 1, "Public", NULL);
 | 
				
			||||||
 | 
					  if(opt) {
 | 
				
			||||||
 | 
					    fprintf(stderr, "Failed to add typed RPC channel\n Failure.\n");
 | 
				
			||||||
 | 
					    return opt;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* ok, let's add stream functions */
 | 
					  /* ok, let's add stream functions */
 | 
				
			||||||
  opt = sntl_rpclist_add_function(fulist, 12, "dir-open", __dir_open);
 | 
					  opt = sntl_rpclist_add_function(fulist, 12, "dir-open", __dir_open);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user