Lines 210-216
Link Here
|
210 |
|
210 |
|
211 |
client_id = CORBA_ORB_object_to_string(orb,cb,&ev); |
211 |
client_id = CORBA_ORB_object_to_string(orb,cb,&ev); |
212 |
if(ev._major != CORBA_NO_EXCEPTION) { |
212 |
if(ev._major != CORBA_NO_EXCEPTION) { |
213 |
LOG("unable to resolve IOR for client"); |
213 |
/* LOG("unable to resolve IOR for client"); */ |
214 |
LOGEXN (ev); |
214 |
LOGEXN (ev); |
215 |
CORBA_exception_free(&ev); |
215 |
CORBA_exception_free(&ev); |
216 |
return NULL; |
216 |
return NULL; |
Lines 309-320
Link Here
|
309 |
|
309 |
|
310 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
310 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
311 |
|
311 |
|
312 |
LOG("corba: request_install(pilot_name=%s (%d),filename=%s,survival=%d,timeout=%d)", |
312 |
/* LOG("corba: request_install(pilot_name=%s (%d),filename=%s,survival=%d,timeout=%d)", |
313 |
pilot_name, |
313 |
pilot_name, |
314 |
pilot_id_from_name(pilot_name,orb_context->gpilotd_context), |
314 |
pilot_id_from_name(pilot_name,orb_context->gpilotd_context), |
315 |
filename, |
315 |
filename, |
316 |
survival, |
316 |
survival, |
317 |
timeout); |
317 |
timeout); */ |
318 |
|
318 |
|
319 |
req.type = GREQ_INSTALL; |
319 |
req.type = GREQ_INSTALL; |
320 |
req.pilot_id = pilot_id_from_name(pilot_name,orb_context->gpilotd_context); |
320 |
req.pilot_id = pilot_id_from_name(pilot_name,orb_context->gpilotd_context); |
Lines 364-375
Link Here
|
364 |
/* FIXME: should be a generic / remover */ |
364 |
/* FIXME: should be a generic / remover */ |
365 |
if (directory[strlen(directory)-1]=='/') |
365 |
if (directory[strlen(directory)-1]=='/') |
366 |
directory[strlen(directory)-1]=0; |
366 |
directory[strlen(directory)-1]=0; |
367 |
LOG("corba: request_restore(pilot_name=%s (%d), directory=%s,survival=%d,timeout=%d)", |
367 |
/* LOG("corba: request_restore(pilot_name=%s (%d), directory=%s,survival=%d,timeout=%d)", |
368 |
pilot_name, |
368 |
pilot_name, |
369 |
pilot_id_from_name(pilot_name,orb_context->gpilotd_context), |
369 |
pilot_id_from_name(pilot_name,orb_context->gpilotd_context), |
370 |
directory, |
370 |
directory, |
371 |
survival, |
371 |
survival, |
372 |
timeout); |
372 |
timeout); */ |
373 |
|
373 |
|
374 |
req.type = GREQ_RESTORE; |
374 |
req.type = GREQ_RESTORE; |
375 |
req.pilot_id = pilot_id_from_name(pilot_name,orb_context->gpilotd_context); |
375 |
req.pilot_id = pilot_id_from_name(pilot_name,orb_context->gpilotd_context); |
Lines 418-427
Link Here
|
418 |
|
418 |
|
419 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
419 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
420 |
|
420 |
|
421 |
LOG("corba: request_conduit(pilot=%s (%d), conduit=%s)", |
421 |
/* LOG("corba: request_conduit(pilot=%s (%d), conduit=%s)", |
422 |
pilot_name, |
422 |
pilot_name, |
423 |
pilot_id_from_name(pilot_name,orb_context->gpilotd_context), |
423 |
pilot_id_from_name(pilot_name,orb_context->gpilotd_context), |
424 |
conduit_name); |
424 |
conduit_name); */ |
425 |
req.pilot_id = pilot_id_from_name(pilot_name,orb_context->gpilotd_context); |
425 |
req.pilot_id = pilot_id_from_name(pilot_name,orb_context->gpilotd_context); |
426 |
|
426 |
|
427 |
if(req.pilot_id==0) { |
427 |
if(req.pilot_id==0) { |
Lines 478-485
Link Here
|
478 |
|
478 |
|
479 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
479 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
480 |
|
480 |
|
481 |
LOG("corba: get_user_info(cradle=%s,survival=%d,timeout=%d)", |
481 |
/* LOG("corba: get_user_info(cradle=%s,survival=%d,timeout=%d)", |
482 |
cradle,survival,timeout); |
482 |
cradle,survival,timeout); */ |
483 |
/* FIXME: check for cradle existance, throw exn if not */ |
483 |
/* FIXME: check for cradle existance, throw exn if not */ |
484 |
req.type = GREQ_GET_USERINFO; |
484 |
req.type = GREQ_GET_USERINFO; |
485 |
req.timeout = survival==GNOME_Pilot_PERSISTENT?0:timeout; |
485 |
req.timeout = survival==GNOME_Pilot_PERSISTENT?0:timeout; |
Lines 505-512
Link Here
|
505 |
gchar *client_id; |
505 |
gchar *client_id; |
506 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
506 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
507 |
|
507 |
|
508 |
LOG("corba: get_system_info(cradle=%s,survival=%d,timeout=%d)", |
508 |
/* LOG("corba: get_system_info(cradle=%s,survival=%d,timeout=%d)", |
509 |
cradle ,survival,timeout); |
509 |
cradle ,survival,timeout); */ |
510 |
|
510 |
|
511 |
req.type = GREQ_GET_SYSINFO; |
511 |
req.type = GREQ_GET_SYSINFO; |
512 |
req.pilot_id = 0; |
512 |
req.pilot_id = 0; |
Lines 534-544
Link Here
|
534 |
|
534 |
|
535 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
535 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
536 |
|
536 |
|
|
|
537 |
/* |
537 |
LOG("corba: set_user_info(cradle=%s,survival=%d,timeout=%d", |
538 |
LOG("corba: set_user_info(cradle=%s,survival=%d,timeout=%d", |
538 |
cradle,survival,timeout); |
539 |
cradle,survival,timeout); |
539 |
LOG("corba: device = %s,",cradle); |
540 |
LOG("corba: device = %s,",cradle); |
540 |
LOG("corba: user_id = %d,",user->userID); |
541 |
LOG("corba: user_id = %d,",user->userID); |
541 |
LOG("corba: user = %s)",user->username); |
542 |
LOG("corba: user = %s)",user->username); |
|
|
543 |
*/ |
542 |
/*LOG("corba: password= %s)",user->password);*/ |
544 |
/*LOG("corba: password= %s)",user->password);*/ |
543 |
/* FIXME: check for cradle existance, throw exn if not */ |
545 |
/* FIXME: check for cradle existance, throw exn if not */ |
544 |
|
546 |
|
Lines 569-580
Link Here
|
569 |
gchar *client_id; |
571 |
gchar *client_id; |
570 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
572 |
GET_AND_CHECK_CLIENT_ID(client_id,cb,0); |
571 |
|
573 |
|
|
|
574 |
/* |
572 |
LOG("corba: set_user_info_if_not_set(cradle=%s,survival=%d,timeout=%d", |
575 |
LOG("corba: set_user_info_if_not_set(cradle=%s,survival=%d,timeout=%d", |
573 |
cradle,survival,timeout); |
576 |
cradle,survival,timeout); |
574 |
LOG("corba: device = %s,",cradle); |
577 |
LOG("corba: device = %s,",cradle); |
575 |
LOG("corba: client_id = %.20s...,",client_id); |
578 |
LOG("corba: client_id = %.20s...,",client_id); |
576 |
LOG("corba: user_id = %d,",user->userID); |
579 |
LOG("corba: user_id = %d,",user->userID); |
577 |
LOG("corba: user = %s)",user->username); |
580 |
LOG("corba: user = %s)",user->username); |
|
|
581 |
*/ |
578 |
/*LOG("corba: password= %s)",user->password);*/ |
582 |
/*LOG("corba: password= %s)",user->password);*/ |
579 |
|
583 |
|
580 |
/* FIXME: check for cradle existance, throw exn if not */ |
584 |
/* FIXME: check for cradle existance, throw exn if not */ |
Lines 613-637
Link Here
|
613 |
CORBA_exception_init(&my_ev); |
617 |
CORBA_exception_init(&my_ev); |
614 |
tmp_client_id = CORBA_ORB_object_to_string(orb,cb,&my_ev); |
618 |
tmp_client_id = CORBA_ORB_object_to_string(orb,cb,&my_ev); |
615 |
if(my_ev._major != CORBA_NO_EXCEPTION) { |
619 |
if(my_ev._major != CORBA_NO_EXCEPTION) { |
616 |
LOG("*** Client appears to be disconnected..."); |
620 |
/* LOG("*** Client appears to be disconnected..."); */ |
617 |
LOGEXN (my_ev); |
621 |
LOGEXN (my_ev); |
618 |
} else { |
622 |
} else { |
619 |
LOG("Client seems ok"); |
623 |
/* LOG("Client seems ok"); */ |
620 |
} |
624 |
} |
621 |
tmpcb = CORBA_ORB_string_to_object(orb,(CORBA_char*)tmp_client_id,&my_ev); |
625 |
tmpcb = CORBA_ORB_string_to_object(orb,(CORBA_char*)tmp_client_id,&my_ev); |
622 |
if(my_ev._major != CORBA_NO_EXCEPTION) { |
626 |
if(my_ev._major != CORBA_NO_EXCEPTION) { |
623 |
LOG("**** Client appears to be disconnected..."); |
627 |
/* LOG("**** Client appears to be disconnected..."); */ |
624 |
LOGEXN (my_ev); |
628 |
LOGEXN (my_ev); |
625 |
g_assert_not_reached(); |
629 |
g_assert_not_reached(); |
626 |
} else { |
630 |
} else { |
627 |
LOG("Client seems ok"); |
631 |
/* LOG("Client seems ok"); */ |
628 |
} |
632 |
} |
629 |
} |
633 |
} |
630 |
#endif |
634 |
#endif |
631 |
|
635 |
|
632 |
GET_AND_CHECK_CLIENT_ID_VOID(client_id,cb); |
636 |
GET_AND_CHECK_CLIENT_ID_VOID(client_id,cb); |
633 |
|
637 |
|
634 |
LOG("monitor_on(pilot_name=\"%s\",client_id = %.20s...)",pilot_name,client_id); |
638 |
/* LOG("monitor_on(pilot_name=\"%s\",client_id = %.20s...)",pilot_name,client_id); */ |
635 |
|
639 |
|
636 |
if(pilot_id_from_name(pilot_name,orb_context->gpilotd_context)==0) { |
640 |
if(pilot_id_from_name(pilot_name,orb_context->gpilotd_context)==0) { |
637 |
g_free(client_id); |
641 |
g_free(client_id); |
Lines 687-693
Link Here
|
687 |
g_assert(pilot!=NULL); |
691 |
g_assert(pilot!=NULL); |
688 |
g_assert(client_id!=NULL); |
692 |
g_assert(client_id!=NULL); |
689 |
|
693 |
|
690 |
LOG("removing monitor on %s for %.10s",pilot,client_id); |
694 |
/* LOG("removing monitor on %s for %.10s",pilot,client_id); */ |
691 |
notifications = g_hash_table_lookup(orb_context->notifications,pilot); |
695 |
notifications = g_hash_table_lookup(orb_context->notifications,pilot); |
692 |
if(notifications==NULL) return; |
696 |
if(notifications==NULL) return; |
693 |
|
697 |
|
Lines 776-790
Link Here
|
776 |
} else { |
780 |
} else { |
777 |
GSList *e; |
781 |
GSList *e; |
778 |
/* This really shouldn't happen, dump list for debug purposes */ |
782 |
/* This really shouldn't happen, dump list for debug purposes */ |
779 |
LOG("Could not find any link for %s",pilot); |
783 |
/* LOG("Could not find any link for %s",pilot); */ |
780 |
for(e=*pilots;e;e = g_slist_next(e)) { |
784 |
for(e=*pilots;e;e = g_slist_next(e)) { |
781 |
LOG("pilots slist dump: %s", |
785 |
/* LOG("pilots slist dump: %s", |
782 |
e->data==NULL?"(null)":(char*)e->data); |
786 |
e->data==NULL?"(null)":(char*)e->data); */ |
783 |
} |
787 |
} |
784 |
} |
788 |
} |
785 |
|
789 |
|
786 |
} else { |
790 |
} else { |
787 |
LOG("couldn't find any monitor for %.10s",client_id); |
791 |
/* LOG("couldn't find any monitor for %.10s",client_id); */ |
788 |
} |
792 |
} |
789 |
|
793 |
|
790 |
|
794 |
|
Lines 804-810
Link Here
|
804 |
|
808 |
|
805 |
GET_AND_CHECK_CLIENT_ID_VOID(client_id,cb); |
809 |
GET_AND_CHECK_CLIENT_ID_VOID(client_id,cb); |
806 |
|
810 |
|
807 |
LOG("monitor_off(pilot_name=\"%.10s\", client_id = %.20s...)",pilot_name,client_id); |
811 |
/* LOG("monitor_off(pilot_name=\"%.10s\", client_id = %.20s...)",pilot_name,client_id); */ |
808 |
if(pilot_id_from_name(pilot_name,orb_context->gpilotd_context)==0) { |
812 |
if(pilot_id_from_name(pilot_name,orb_context->gpilotd_context)==0) { |
809 |
g_free(client_id); |
813 |
g_free(client_id); |
810 |
gpthrow_no_val_with_settings(UnknownPilot,exn,exn->pilotId = CORBA_string_dup(pilot_name)); |
814 |
gpthrow_no_val_with_settings(UnknownPilot,exn,exn->pilotId = CORBA_string_dup(pilot_name)); |
Lines 902-909
Link Here
|
902 |
event_type = g_strdup("USERINFO_SENT"); break; |
906 |
event_type = g_strdup("USERINFO_SENT"); break; |
903 |
default: g_assert_not_reached(); break; |
907 |
default: g_assert_not_reached(); break; |
904 |
} |
908 |
} |
905 |
LOG("corba: notify_on(event_type=%s,callback=%.20s...)", |
909 |
/* LOG("corba: notify_on(event_type=%s,callback=%.20s...)", |
906 |
event_type,client_id); |
910 |
event_type,client_id); */ |
907 |
g_free(event_type); |
911 |
g_free(event_type); |
908 |
} |
912 |
} |
909 |
|
913 |
|
Lines 951-958
Link Here
|
951 |
event_type = g_strdup("USERINFO_SENT"); break; |
955 |
event_type = g_strdup("USERINFO_SENT"); break; |
952 |
default: g_assert_not_reached(); break; |
956 |
default: g_assert_not_reached(); break; |
953 |
} |
957 |
} |
954 |
LOG("corba: notify_off(event_type=%s,callback=%.20s...)", |
958 |
/* LOG("corba: notify_off(event_type=%s,callback=%.20s...)", |
955 |
event_type,client_id); |
959 |
event_type,client_id); */ |
956 |
g_free(event_type); |
960 |
g_free(event_type); |
957 |
} |
961 |
} |
958 |
|
962 |
|
Lines 977-983
Link Here
|
977 |
CORBA_Environment *ev) |
981 |
CORBA_Environment *ev) |
978 |
{ |
982 |
{ |
979 |
|
983 |
|
980 |
LOG("corba: get_users()"); |
984 |
/* LOG("corba: get_users()"); */ |
981 |
|
985 |
|
982 |
/* FIXME: this isn't complete, it only gives one user, and |
986 |
/* FIXME: this isn't complete, it only gives one user, and |
983 |
doesn't make any NULL checks... */ |
987 |
doesn't make any NULL checks... */ |
Lines 998-1004
Link Here
|
998 |
CORBA_Environment *ev) |
1002 |
CORBA_Environment *ev) |
999 |
{ |
1003 |
{ |
1000 |
|
1004 |
|
1001 |
LOG("corba: get_cradles(...)"); |
1005 |
/* LOG("corba: get_cradles(...)"); */ |
1002 |
|
1006 |
|
1003 |
if(g_list_length(orb_context->gpilotd_context->devices)>0) { |
1007 |
if(g_list_length(orb_context->gpilotd_context->devices)>0) { |
1004 |
GNOME_Pilot_StringSequence *cradles; |
1008 |
GNOME_Pilot_StringSequence *cradles; |
Lines 1023-1029
Link Here
|
1023 |
CORBA_Environment *ev) |
1027 |
CORBA_Environment *ev) |
1024 |
{ |
1028 |
{ |
1025 |
|
1029 |
|
1026 |
LOG("corba: get_pilots(...)"); |
1030 |
/* LOG("corba: get_pilots(...)"); */ |
1027 |
|
1031 |
|
1028 |
if(g_list_length(orb_context->gpilotd_context->pilots)>0) { |
1032 |
if(g_list_length(orb_context->gpilotd_context->pilots)>0) { |
1029 |
GNOME_Pilot_StringSequence *pilots; |
1033 |
GNOME_Pilot_StringSequence *pilots; |
Lines 1048-1054
Link Here
|
1048 |
CORBA_Environment *ev) |
1052 |
CORBA_Environment *ev) |
1049 |
{ |
1053 |
{ |
1050 |
|
1054 |
|
1051 |
LOG("corba: get_pilot_ids(...)"); |
1055 |
/* LOG("corba: get_pilot_ids(...)"); */ |
1052 |
|
1056 |
|
1053 |
if(g_list_length(orb_context->gpilotd_context->pilots)>0) { |
1057 |
if(g_list_length(orb_context->gpilotd_context->pilots)>0) { |
1054 |
GNOME_Pilot_LongSequence *pilots; |
1058 |
GNOME_Pilot_LongSequence *pilots; |
Lines 1074-1086
Link Here
|
1074 |
{ |
1078 |
{ |
1075 |
int cnt; |
1079 |
int cnt; |
1076 |
|
1080 |
|
1077 |
LOG("corba: get_pilots_by_name(%s)",user); |
1081 |
/* LOG("corba: get_pilots_by_name(%s)",user); */ |
1078 |
|
1082 |
|
1079 |
/* FIXME: this could probably be prettyfied with some _foreach thingies... */ |
1083 |
/* FIXME: this could probably be prettyfied with some _foreach thingies... */ |
1080 |
if(g_list_length(orb_context->gpilotd_context->pilots)>0) { |
1084 |
if(g_list_length(orb_context->gpilotd_context->pilots)>0) { |
1081 |
GNOME_Pilot_StringSequence *pilots; |
1085 |
GNOME_Pilot_StringSequence *pilots; |
1082 |
int i; |
1086 |
int i; |
1083 |
LOG("g_list_length(orb_context->gpilotd_context->pilots) = %d",g_list_length(orb_context->gpilotd_context->pilots)); |
1087 |
/* LOG("g_list_length(orb_context->gpilotd_context->pilots) = %d",g_list_length(orb_context->gpilotd_context->pilots)); */ |
1084 |
|
1088 |
|
1085 |
/* first count the number of pilots to cp */ |
1089 |
/* first count the number of pilots to cp */ |
1086 |
cnt=0; |
1090 |
cnt=0; |
Lines 1088-1099
Link Here
|
1088 |
for(i=0;i<g_list_length(orb_context->gpilotd_context->pilots);i++) { |
1092 |
for(i=0;i<g_list_length(orb_context->gpilotd_context->pilots);i++) { |
1089 |
if(strcmp(GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->pilot_username, |
1093 |
if(strcmp(GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->pilot_username, |
1090 |
user)==0) { |
1094 |
user)==0) { |
1091 |
LOG("match on %s",GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->name); |
1095 |
/* LOG("match on %s",GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->name); */ |
1092 |
cnt++; |
1096 |
cnt++; |
1093 |
} |
1097 |
} |
1094 |
} |
1098 |
} |
1095 |
if(cnt==0) { |
1099 |
if(cnt==0) { |
1096 |
LOG("no matches on %s",user); |
1100 |
/* LOG("no matches on %s",user); */ |
1097 |
return empty_StringSequence(); |
1101 |
return empty_StringSequence(); |
1098 |
} |
1102 |
} |
1099 |
|
1103 |
|
Lines 1123-1129
Link Here
|
1123 |
struct passwd *pwdent; |
1127 |
struct passwd *pwdent; |
1124 |
GNOME_Pilot_StringSequence *pilots; |
1128 |
GNOME_Pilot_StringSequence *pilots; |
1125 |
|
1129 |
|
1126 |
LOG("corba: get_pilots_by_login(%s)",uid); |
1130 |
/* LOG("corba: get_pilots_by_login(%s)",uid); */ |
1127 |
|
1131 |
|
1128 |
/* find the pwdent matching the login */ |
1132 |
/* find the pwdent matching the login */ |
1129 |
username = NULL; |
1133 |
username = NULL; |
Lines 1141-1147
Link Here
|
1141 |
|
1145 |
|
1142 |
/* no luck ? */ |
1146 |
/* no luck ? */ |
1143 |
if(!username) { |
1147 |
if(!username) { |
1144 |
LOG("no realname for %s",uid); |
1148 |
/* LOG("no realname for %s",uid); */ |
1145 |
return empty_StringSequence(); |
1149 |
return empty_StringSequence(); |
1146 |
} |
1150 |
} |
1147 |
|
1151 |
|
Lines 1160-1166
Link Here
|
1160 |
#ifdef __GNUC__ |
1164 |
#ifdef __GNUC__ |
1161 |
#warning gpilotd_corba_get_user_name_by_pilot not implemented |
1165 |
#warning gpilotd_corba_get_user_name_by_pilot not implemented |
1162 |
#endif |
1166 |
#endif |
1163 |
LOG("corba: FIXME %s:%d get_user_name_by_pilot", __FILE__, __LINE__); |
1167 |
/* LOG("corba: FIXME %s:%d get_user_name_by_pilot", __FILE__, __LINE__); */ |
1164 |
|
1168 |
|
1165 |
/* FIXME: not implemented yet */ |
1169 |
/* FIXME: not implemented yet */ |
1166 |
return CORBA_string_dup ("Foo Bar"); |
1170 |
return CORBA_string_dup ("Foo Bar"); |
Lines 1174-1180
Link Here
|
1174 |
#ifdef __GNUC__ |
1178 |
#ifdef __GNUC__ |
1175 |
#warning gpilotd_corba_get_user_login_by_pilot not implemented |
1179 |
#warning gpilotd_corba_get_user_login_by_pilot not implemented |
1176 |
#endif |
1180 |
#endif |
1177 |
LOG("corba: FIXME %s:%d get_user_login_by_pilot", __FILE__, __LINE__); |
1181 |
/* LOG("corba: FIXME %s:%d get_user_login_by_pilot", __FILE__, __LINE__); */ |
1178 |
|
1182 |
|
1179 |
/* FIXME: not implemented yet */ |
1183 |
/* FIXME: not implemented yet */ |
1180 |
return CORBA_string_dup ("foo"); |
1184 |
return CORBA_string_dup ("foo"); |
Lines 1185-1191
Link Here
|
1185 |
CORBA_char * pilot_name, |
1189 |
CORBA_char * pilot_name, |
1186 |
CORBA_Environment * ev) { |
1190 |
CORBA_Environment * ev) { |
1187 |
int i; |
1191 |
int i; |
1188 |
LOG("corba: get_pilot_base_dir(id=%s)",pilot_name); |
1192 |
/* LOG("corba: get_pilot_base_dir(id=%s)",pilot_name); */ |
1189 |
|
1193 |
|
1190 |
|
1194 |
|
1191 |
/* FIXME: this could probably be prettyfied with some _foreach thingies... */ |
1195 |
/* FIXME: this could probably be prettyfied with some _foreach thingies... */ |
Lines 1194-1200
Link Here
|
1194 |
for(i=0;i<g_list_length(orb_context->gpilotd_context->pilots);i++) { |
1198 |
for(i=0;i<g_list_length(orb_context->gpilotd_context->pilots);i++) { |
1195 |
if(strcmp(GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->name, |
1199 |
if(strcmp(GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->name, |
1196 |
pilot_name)==0) { |
1200 |
pilot_name)==0) { |
1197 |
LOG("match on %s",GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->name); |
1201 |
/* LOG("match on %s",GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->name); */ |
1198 |
if(GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->sync_options.basedir!=NULL) { |
1202 |
if(GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->sync_options.basedir!=NULL) { |
1199 |
return CORBA_string_dup(GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->sync_options.basedir); |
1203 |
return CORBA_string_dup(GPILOT_PILOT(g_list_nth(orb_context->gpilotd_context->pilots,i)->data)->sync_options.basedir); |
1200 |
} else { |
1204 |
} else { |
Lines 1202-1208
Link Here
|
1202 |
} |
1206 |
} |
1203 |
} |
1207 |
} |
1204 |
} |
1208 |
} |
1205 |
LOG("no matches on %s",pilot_name); |
1209 |
/* LOG("no matches on %s",pilot_name); */ |
1206 |
return CORBA_string_dup(""); |
1210 |
return CORBA_string_dup(""); |
1207 |
} else |
1211 |
} else |
1208 |
return CORBA_string_dup(""); |
1212 |
return CORBA_string_dup(""); |
Lines 1212-1218
Link Here
|
1212 |
gpilotd_get_pilot_id_from_name(PortableServer_Servant _servant, |
1216 |
gpilotd_get_pilot_id_from_name(PortableServer_Servant _servant, |
1213 |
CORBA_char * pilot_name, |
1217 |
CORBA_char * pilot_name, |
1214 |
CORBA_Environment * ev) { |
1218 |
CORBA_Environment * ev) { |
1215 |
LOG("corba: get_user_pilot_id_from_name"); |
1219 |
/* LOG("corba: get_user_pilot_id_from_name"); */ |
1216 |
|
1220 |
|
1217 |
return pilot_id_from_name(pilot_name,orb_context->gpilotd_context); |
1221 |
return pilot_id_from_name(pilot_name,orb_context->gpilotd_context); |
1218 |
} |
1222 |
} |
Lines 1223-1229
Link Here
|
1223 |
CORBA_Environment * ev) { |
1227 |
CORBA_Environment * ev) { |
1224 |
gchar *tmp; |
1228 |
gchar *tmp; |
1225 |
CORBA_char *retval; |
1229 |
CORBA_char *retval; |
1226 |
LOG("corba: get_pilot_name_from_id(id=%d)",pilot_name); |
1230 |
/* LOG("corba: get_pilot_name_from_id(id=%d)",pilot_name); */ |
1227 |
|
1231 |
|
1228 |
tmp = pilot_name_from_id(pilot_name,orb_context->gpilotd_context); |
1232 |
tmp = pilot_name_from_id(pilot_name,orb_context->gpilotd_context); |
1229 |
retval = CORBA_string_dup(tmp); |
1233 |
retval = CORBA_string_dup(tmp); |
Lines 1240-1246
Link Here
|
1240 |
char **databases,*pfx; |
1244 |
char **databases,*pfx; |
1241 |
int num_bases; |
1245 |
int num_bases; |
1242 |
guint32 pilot_id; |
1246 |
guint32 pilot_id; |
1243 |
LOG("corba: get_databases_from_cache(...)"); |
1247 |
/* LOG("corba: get_databases_from_cache(...)"); */ |
1244 |
|
1248 |
|
1245 |
pilot_id = pilot_id_from_name(pilot_name, |
1249 |
pilot_id = pilot_id_from_name(pilot_name, |
1246 |
orb_context->gpilotd_context); |
1250 |
orb_context->gpilotd_context); |
Lines 1415-1421
Link Here
|
1415 |
|
1419 |
|
1416 |
cb = CORBA_ORB_string_to_object(orb,(CORBA_char*)IOR,&ev); |
1420 |
cb = CORBA_ORB_string_to_object(orb,(CORBA_char*)IOR,&ev); |
1417 |
if(ev._major != CORBA_NO_EXCEPTION) { |
1421 |
if(ev._major != CORBA_NO_EXCEPTION) { |
1418 |
LOG("Client appears to be disconnected..."); |
1422 |
/* LOG("Client appears to be disconnected..."); */ |
1419 |
g_warning ("%s:%d Exception: %s\n", |
1423 |
g_warning ("%s:%d Exception: %s\n", |
1420 |
__FILE__,__LINE__, CORBA_exception_id (&ev)); |
1424 |
__FILE__,__LINE__, CORBA_exception_id (&ev)); |
1421 |
CORBA_exception_free(&ev); |
1425 |
CORBA_exception_free(&ev); |
Lines 1481-1487
Link Here
|
1481 |
break; |
1485 |
break; |
1482 |
} |
1486 |
} |
1483 |
if(ev._major != CORBA_NO_EXCEPTION) { |
1487 |
if(ev._major != CORBA_NO_EXCEPTION) { |
1484 |
LOG("Client appears to be disconnected..."); |
1488 |
/* LOG("Client appears to be disconnected..."); */ |
1485 |
LOGEXN (ev); |
1489 |
LOGEXN (ev); |
1486 |
CORBA_exception_free(&ev); |
1490 |
CORBA_exception_free(&ev); |
1487 |
carrier->purge_list = g_slist_prepend(carrier->purge_list, |
1491 |
carrier->purge_list = g_slist_prepend(carrier->purge_list, |
Lines 1518-1525
Link Here
|
1518 |
carrier.purge_list = NULL; |
1522 |
carrier.purge_list = NULL; |
1519 |
carrier.action = CALL_CONNECT; |
1523 |
carrier.action = CALL_CONNECT; |
1520 |
#ifdef DEBUG_CODE |
1524 |
#ifdef DEBUG_CODE |
1521 |
LOG("corba: orbed_notify_user, notifications->connect.size = %d, id = %s", |
1525 |
/* LOG("corba: orbed_notify_user, notifications->connect.size = %d, id = %s", |
1522 |
g_slist_length(notifications->connect),pilot_id); |
1526 |
g_slist_length(notifications->connect),pilot_id); */ |
1523 |
#endif |
1527 |
#endif |
1524 |
g_slist_foreach(notifications->connect, |
1528 |
g_slist_foreach(notifications->connect, |
1525 |
(GFunc)orbed_notify_multi_purpose_foreach, |
1529 |
(GFunc)orbed_notify_multi_purpose_foreach, |
Lines 1550-1557
Link Here
|
1550 |
carrier.purge_list = NULL; |
1554 |
carrier.purge_list = NULL; |
1551 |
carrier.action = CALL_DISCONNECT; |
1555 |
carrier.action = CALL_DISCONNECT; |
1552 |
#ifdef DEBUG_CODE |
1556 |
#ifdef DEBUG_CODE |
1553 |
LOG("corba: orbed_notify_user, notifications->disconnect.size = %d, id = %s", |
1557 |
/* LOG("corba: orbed_notify_user, notifications->disconnect.size = %d, id = %s", |
1554 |
g_slist_length(notifications->disconnect),pilot_id); |
1558 |
g_slist_length(notifications->disconnect),pilot_id); */ |
1555 |
#endif |
1559 |
#endif |
1556 |
g_slist_foreach(notifications->disconnect, |
1560 |
g_slist_foreach(notifications->disconnect, |
1557 |
(GFunc)orbed_notify_multi_purpose_foreach, |
1561 |
(GFunc)orbed_notify_multi_purpose_foreach, |
Lines 1573-1590
Link Here
|
1573 |
GNOME_Pilot_Client cb; |
1577 |
GNOME_Pilot_Client cb; |
1574 |
gchar *pilot_name; |
1578 |
gchar *pilot_name; |
1575 |
|
1579 |
|
1576 |
LOG("orbed_notify_completion(...)"); |
1580 |
/* LOG("orbed_notify_completion(...)"); */ |
1577 |
|
1581 |
|
1578 |
g_return_if_fail(req!=NULL); |
1582 |
g_return_if_fail(req!=NULL); |
1579 |
g_return_if_fail(*req!=NULL); |
1583 |
g_return_if_fail(*req!=NULL); |
1580 |
|
1584 |
|
1581 |
/* If there is no client to notify, just purge request and return */ |
1585 |
/* If there is no client to notify, just purge request and return */ |
1582 |
if((*req)->client_id==NULL) { |
1586 |
if((*req)->client_id==NULL) { |
1583 |
LOG("%s: no client_id in request",__PRETTY_FUNCTION__); |
1587 |
/* LOG("%s: no client_id in request",__PRETTY_FUNCTION__); */ |
1584 |
gpc_queue_purge_request(req); |
1588 |
gpc_queue_purge_request(req); |
1585 |
return; |
1589 |
return; |
1586 |
} |
1590 |
} |
1587 |
LOG("%s: client_id = %.20s",__PRETTY_FUNCTION__,(*req)->client_id); |
1591 |
/* LOG("%s: client_id = %.20s",__PRETTY_FUNCTION__,(*req)->client_id); */ |
1588 |
|
1592 |
|
1589 |
/* check the client id is a IOR */ |
1593 |
/* check the client id is a IOR */ |
1590 |
g_return_if_fail(strncmp((*req)->client_id,"IOR:",4)==0); |
1594 |
g_return_if_fail(strncmp((*req)->client_id,"IOR:",4)==0); |
Lines 1595-1601
Link Here
|
1595 |
/* get the ior, if it fails, print exception and purge request */ |
1599 |
/* get the ior, if it fails, print exception and purge request */ |
1596 |
cb = CORBA_ORB_string_to_object(orb,(CORBA_char*)(*req)->client_id,&ev); |
1600 |
cb = CORBA_ORB_string_to_object(orb,(CORBA_char*)(*req)->client_id,&ev); |
1597 |
if(ev._major != CORBA_NO_EXCEPTION) { |
1601 |
if(ev._major != CORBA_NO_EXCEPTION) { |
1598 |
LOG("unable to resolve object for IOR"); |
1602 |
/* LOG("unable to resolve object for IOR"); */ |
1599 |
LOGEXN (ev); |
1603 |
LOGEXN (ev); |
1600 |
CORBA_exception_free(&ev); |
1604 |
CORBA_exception_free(&ev); |
1601 |
/* FIXME: This purges monitors for the client. |
1605 |
/* FIXME: This purges monitors for the client. |